home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 67 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  27 lines

  1. Newsgroups: comp.std.c
  2. Path: info.physics.utoronto.ca!utzoo!spenford!henry
  3. From: Henry Spencer <henry@zoo.toronto.edu>
  4. Subject: Re: Undefined result vs. int's holding undefined values.
  5. References: <oZA8wQ9ytpjN084yn@csn.net> <4cs460$d6e@news.informix.com> <821155074snz@genesis.demon.co.uk>
  6. Sender: henry%spenford@zoo.toronto.edu (Henry Spencer)
  7. Organization: SP Systems, Toronto
  8. Date: Tue, 9 Jan 1996 19:50:08 GMT
  9. Message-ID: <DKxJ3K.4u1%spenford@zoo.toronto.edu>
  10.  
  11. > Does an appropriate "SAFE TEST" exist
  12. >for multiple.  Has anyone actually seen a real production program where every
  13. >calculation was protected against overflow/underflow.
  14.  
  15. Safe tests exist for all the arithmetic operations, although you have to
  16. be careful and clever.  See the paper "On Legality Assertions in Euclid",
  17. by Dave Wortman in the July 1979 IEEE Transactions on Software Engineering,
  18. for a fairly complete discussion of the matter.
  19.  
  20. A program in which overflow/underflow can occur is a buggy program.  In
  21. most cases, the nature of the program is such that the calculations
  22. can be shown not to overflow/underflow.  Where this is not so, checks
  23. are necessary for a reliable program.
  24. -- 
  25. Look, look, see Windows 95.  Buy, lemmings, buy!   |       Henry Spencer
  26. Pay no attention to that cliff ahead...            |   henry@zoo.toronto.edu
  27.